/* © Jean-Pest 2011 */
/* Link "objects"   */
#include "node.h"

/*  Type Node  */
typedef struct link link;
struct link
{
	/* Member Variables */
    char* line;	     /* Line Number      */
	node  ext1,ext2; /* Link Extremities */
	
	/* Member Routines */
		/* Line handling */
	void  (*set_line) (link* , char*);
	char* (*get_line) (link*);
	
		/* Set extremity */
	void  (*setext1) (link*, node*);
	void  (*setext2) (link*, node*);
	
		/* Get extremity */
	node* (*getext1) (link*);
	node* (*getext2) (link*);
	
		/* Display */
	void (*print) (link*);
	
		/* Self destroy */
	void (*destroy) (link*);
};

/* Base functions, to be aliased in the fake object */

/* Creation */
link* l_new (void);

/* Initialisation */
static void l_init(link*);

/* Name handling */
void  l_lset(link*, char*);
char* l_lget(link*);

/* Position */
/* set */
void l_setext(link*, int, node*);
/* get */
int  l_getext(link*, int);

/* Display */
void l_print (link*);

/* Destroy */
void  l_destroy();